package com.aspose.cells;

import java.util.ArrayList;
import java.util.List;

final class zbvv {
   static ArrayList a(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2, float var3, double var4, int var6) {
      zif var7 = var1.v();
      int var8 = var1.af();
      zbo var9;
      zbo var10;
      if (var8 == 1) {
         var10 = var7.e();
         var9 = var7.E();
      } else {
         var10 = var7.g();
         var9 = var7.G();
      }

      double var11 = var9.n() ? zbuk.e(var9.D()) : var9.D();
      double var13 = var9.n() ? zbuk.e(var9.z()) : var9.z();
      var4 = var9.n() ? zbuk.e(var4) : var4;
      double var15 = var10.n() ? zbuk.e(var10.D()) : var10.D();
      double var17 = var10.n() ? zbuk.e(var10.z()) : var10.z();
      boolean var19 = var1.L();
      zalv var20 = var1.O();
      zalv var21 = var1.P();
      ziw var22 = var1.S();
      ziw var23 = var1.T();
      ArrayList var24 = new ArrayList();
      double var25 = (double)var2.e() / (var17 - var15);
      int var27 = var6;
      if (var10.p) {
         var27 = (int)var10.z();
         if (var10.f()) {
            var25 = (double)var2.e() / (var17 - var15 + 1.0D);
         }
      }

      ArrayList var28 = new ArrayList();
      com.aspose.cells.b.a.b.zm var29 = null;
      ArrayList var30 = new ArrayList();
      zjf var31 = var1.D();

      for(int var32 = 0; var32 < var27; ++var32) {
         zjd var33 = var31.b(var32);
         if (var33 != null && !var33.a() && !var33.b() && !var33.H()) {
            if (var29 != null) {
               var29.a();
            }

            var29 = zama.a(var33.k());
            double var34 = (double)((float)var25) * (var33.q() - var15);
            if (var10.f()) {
               var34 += (double)((float)var25 / 2.0F);
            }

            if (var10.p()) {
               var34 = (double)(var2.c() + var2.e()) - var34;
            } else {
               var34 += (double)var2.c();
            }

            double var36 = (double)var3;
            double var38 = var33.v();
            double var40 = (var38 - var4) / (var13 - var11) * (double)var2.f();
            zsp var42 = var1.y();
            com.aspose.cells.b.a.b.zo var43 = new com.aspose.cells.b.a.b.zo((float)var34, var3);
            double var44 = 0.0D;
            double var46 = 0.0D;
            float var48 = 0.0F;
            float var49 = 0.0F;
            if (var42 != null) {
               switch(var42.g()) {
               case 0:
                  double var50 = var42.e().size() > var32 ? var42.a(var42.e().get(var32)) : 0.0D;
                  var44 = var50;
                  var50 = var42.f().size() > var32 ? var42.a(var42.f().get(var32)) : 0.0D;
                  var46 = var50;
                  break;
               case 1:
                  var44 = var42.c();
                  var46 = var44;
                  break;
               case 2:
                  var44 = var42.c() * var33.q() / 100.0D;
                  var46 = -var44;
               }

               var48 = (float)(var44 / (var17 - var15) * (double)var2.e());
               var49 = (float)(var46 / (var17 - var15) * (double)var2.e());
               if (!var9.p()) {
                  var43.b(var43.e() - (float)var40);
               } else {
                  var43.b(var43.e() + (float)var40);
               }
            }

            var42.a(var43, var48, var49);
            zsp var54 = var1.x();
            var44 = 0.0D;
            var46 = 0.0D;
            var48 = 0.0F;
            var49 = 0.0F;
            if (var54 != null) {
               switch(var54.g()) {
               case 0:
                  double var51 = var54.e().size() > var32 ? var54.a(var54.e().get(var32)) : 0.0D;
                  var44 = var51;
                  var51 = var54.f().size() > var32 ? var54.a(var54.f().get(var32)) : 0.0D;
                  var46 = var51;
                  break;
               case 1:
                  var44 = var54.c();
                  var46 = var44;
                  break;
               case 2:
                  var44 = var54.c() * var33.v() / 100.0D;
                  var46 = -var44;
               }

               var48 = (float)var44 / (float)(var13 - var11) * (float)var2.f();
               var49 = (float)var46 / (float)(var13 - var11) * (float)var2.f();
            }

            var54.a(var43, var48, var49);
            if (!var9.p()) {
               var36 -= var40;
            } else {
               var36 += var40;
            }

            com.aspose.cells.b.a.b.zo var55 = new com.aspose.cells.b.a.b.zo((float)var34, (float)var36);
            com.aspose.cells.b.a.a.ze.a(var30, (Object)var55);
            zpt var52 = var33.o();
            if (var52.t()) {
               Object[] var53 = new Object[]{var1.ai(), var32, var55, var10};
               com.aspose.cells.b.a.a.ze.a(var24, (Object)var53);
            }
         } else {
            com.aspose.cells.b.a.a.ze.a(var30, (Object)null);
         }
      }

      if (var29 == null) {
         var29 = zama.a(var1.z());
      }

      zkq.a((zn)var0, (zbcp)var1, (List)var30, (com.aspose.cells.b.a.b.zm)var29, (com.aspose.cells.b.a.b.zp)var2);
      zkq.a(var0, var1, (List)var30, (com.aspose.cells.b.a.b.zp)var2);
      if (var29 != null) {
         var29.a();
      }

      com.aspose.cells.b.a.a.ze.a(var28, (Object)var30);
      return var24;
   }
}
